package com.ddstation.onsitelaw.mapper;

import com.ddstation.onsitelaw.entity.AccountInEntity;
import com.ddstation.onsitelaw.entity.AccountSaveEntity;
import com.ddstation.onsitelaw.entity.DtInvsManageInstitutionSupervisorEntity;
import com.ddstation.onsitelaw.model.AccountModel;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.HashMap;
import java.util.List;


/**
 * @author 忆秋枫
 */
public interface DtInvsManageInstitutionSupervisorMapper extends Mapper<DtInvsManageInstitutionSupervisorEntity> {

    /**
     * 修改密码
     *
     * @param supervisorId 用户ID
     * @param newPassword  新密码
     */
    void updatePassword(@Param("supervisorId") Integer supervisorId, @Param("newPassword") String newPassword);

    /**
     * 绑定微信账户
     *
     * @param supervisorId
     * @param wxUserId
     */
    void updateWxUserId(@Param("supervisorId") Integer supervisorId, @Param("wxUserId") Integer wxUserId);


    /**
     * 修改监管区域
     *
     * @param supervisorId  用户ID
     * @param institutionId 监管区域ID
     */
    void updateInstitutionId(@Param("supervisorId") Integer supervisorId, @Param("institutionId") String institutionId);


    /**
     * 查询数据条数
     *
     * @param inEntity 入参实体
     * @return Integer 数据总条数
     */
    Integer countPage(AccountInEntity inEntity);

    /**
     * 根据账号ID查询账户
     *
     * @param id 账号ID
     * @return AccountModel
     */
    AccountModel selectById(@Param("id") Integer id);

    /**
     * 根据账号ID删除账户
     *
     * @param id 账号ID
     * @return int
     */
    int deleteById(@Param("id") Integer id);

    /**
     * 根据账号名称查询账户
     *
     * @param loginUser 账号名称
     * @return AccountModel
     */
    AccountModel selectByLoginUser(@Param("loginUser") String loginUser);

    /**
     * 添加信息到supervisor表
     *
     * @param saveEntity 保存信息实体
     */
    void saveSupervisor(AccountSaveEntity saveEntity);

    /**
     * 添加信息到institution_supervisor表
     *
     * @param saveEntity 保存信息实体
     */
    void saveInstitutionSupervisor(AccountSaveEntity saveEntity);

    /**
     * @param map
     * @return
     */
    List<AccountModel> selectSupervisors(HashMap map);

    /**
     * @param map
     * @return
     */
    List<AccountModel> selectManagerAndSupervisors(HashMap map);


    /**
     * @return
     */
    List<AccountModel> selectAllSupervisors();
}